/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.vfi.bc;

import edu.upn.sigemfi.vfi.be.DetalleCaja;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Alex
 */
@Stateless
public class DetalleCajaFacade implements DetalleCajaFacadeLocal {
    @PersistenceContext(unitName="edu.upn.sigemfi.vfi-ejbPU")
    private EntityManager em;

    public void create(DetalleCaja detalleCaja) {
        em.persist(detalleCaja);
    }

    public void edit(DetalleCaja detalleCaja) {
        em.merge(detalleCaja);
    }

    public void remove(DetalleCaja detalleCaja) {
        em.remove(em.merge(detalleCaja));
    }

    public DetalleCaja find(Object id) {
        return em.find(DetalleCaja.class, id);
    }

    public List<DetalleCaja> findAll() {
        return em.createQuery("select object(o) from DetalleCaja as o").getResultList();
    }

   

}
